import request from '@/utils/request'

// 获取类型列表
export const getSKU = params => request.get('/api/vm-service/skuClass/search', { params })

// 删除类型
export const delSKU = id => request.delete('/api/vm-service/skuClass/' + id)

// 修改商品类型
export const putSKU = data => request({
  method: 'PUT',
  url: '/api/vm-service/skuClass/' + data.id,
  data: data.data
})

// 新增商品类型
export const addSKU = data => request.post('/api/vm-service/skuClass', data)

// 获取商品列表
export const searchSKU = params => request.get('/api/vm-service/sku/search', { params })

// 新增商品
export const addGoods = data => request.post('/api/vm-service/sku', data)

// 修改商品
export const putGoods = data => request({
  method: 'PUT',
  url: '/api/vm-service/sku/' + data.id,
  data: data.data
})

// 上传文件
export const uploadGoods = data => request.post('/api/vm-service/sku/upload', data)
